package io.jpress.module.smLock.service.provider;

import io.jboot.aop.annotation.Bean;
import io.jboot.db.model.Columns;
import io.jpress.module.smLock.service.LockHistoryService;
import io.jpress.module.smLock.model.LockHistory;
import io.jboot.service.JbootServiceBase;

import javax.inject.Singleton;

@Bean
@Singleton
public class LockHistoryServiceProvider extends JbootServiceBase<LockHistory> implements LockHistoryService {

    @Override
    public LockHistory findByCabinetIdOccupy(Object id) {
        return DAO.findFirstByColumns(Columns.create().add("lock_lockerId", id).add("occupy", true));

    }
}